#ifndef VIDEO_DECODER_H
#define VIDEO_DECODER_H

#include <QWidget>
#include "XvidDec.h"
#include <QFile>
#include <QElapsedTimer>
 #include <QCoreApplication>
#include <QTimer>
#include "rtpdata_recieve_thread.h"


class video_decoder : public QWidget,public CXvidDecHandler
{
    Q_OBJECT
public:
    explicit video_decoder(QWidget *parent = 0);
    void PostDecHandler(unsigned char * image, int used_bytes) ;
    ~video_decoder();
    int read_video_stream(QString filename);
    QByteArray instream;
signals:
    
public slots:
    void refresh_timeout();
private:
    CXvidDec *  decoder ;
    void paintEvent(QPaintEvent *event );
    QFile* video_file;
    rtpdata_recieve_thread rtprecthread;
    uchar* outstream;
    int ret;
    QTimer* refresh_timer;
  //  QElapsedTimer t;
};

#endif // VIDEO_DECODER_H
